<div class="td-patient-me-medical-detail">

  <div class="btn">
    <el-button size="mini" type="primary" @click.native="btnClick();">点击下载病例</el-button>
  </div>

  <div id="table-box" ref="copyCardArea" v-if="load">
    <h1>添丁病例&nbsp;|&nbsp;姓名:{{user.UserName}}&nbsp;|&nbsp;生成时间:{{currDate.year}}-{{currDate.month}}-{{currDate.day}}
      {{currDate.hour}}:{{currDate.minute}}:{{currDate.second}}</h1>
    <h2>基本信息</h2>
    <table>
      <tr>
        <th>姓名</th>
        <th>年龄</th>
        <th>配偶</th>
        <th>身高</th>
        <th>体重</th>
        <th>BMI</th>
        <th>血压</th>
        <th>药物过敏史</th>
        <th>感染项目</th>
      </tr>
      <tr>
        <td>{{user.UserName}}</td>
        <td>{{baseInfoList.Age}}岁</td>
        <td>{{baseInfoList.MateAge}}岁</td>
        <td>{{baseInfoList.Height}}</td>
        <td>{{baseInfoList.Weight}}</td>
        <td>{{baseInfoList.BMI}}</td>
        <td>{{baseInfoList.Max_BP}}mmHg/{{baseInfoList.Min_BP}}mmHg</td>
        <td>{{baseInfoList.AllergyHistory}}</td>
        <td class="baseInfoListInfectionProject">
          <div v-for="(arg,index) in baseInfoList.InfectionProject" :key="index">
            <p>项目名称：{{infectionProjectList.find(i=>i.key===arg.ProjectName).value}}</p>
            <p>检测医院：{{arg.CheckHospital}}</p>
            <p>检测日期：{{arg.CheckTime.split('T')[0]}}</p>
          </div>
        </td>
      </tr>
    </table>
    <h2>目前状态</h2>
    <table>
      <tr>
        <th>现状</th>
        <th>治疗方案</th>
        <th>受孕方式</th>
        <th v-if="currentStatusList.CurrentStatus===3">孕周</th>
        <th>用药</th>
        <th>其他用药</th>
      </tr>
      <tr>
        <td>
          <span v-if="currentStatusList.CurrentStatus===0">检查中</span>
          <span v-if="currentStatusList.CurrentStatus===1">治疗中</span>
          <span v-if="currentStatusList.CurrentStatus===2">备孕/移植</span>
          <span v-if="currentStatusList.CurrentStatus===3">已孕</span>
        </td>
        <td>
          <span v-if="currentStatusList.IsHasTreatMents===0">检查中</span>
          <span v-if="currentStatusList.IsHasTreatMents===1">治疗中</span>
        </td>
        <td>
          <span v-if="currentStatusList.PregnancyWay===0">检查中</span>
          <span v-if="currentStatusList.PregnancyWay===1">治疗中</span>
          <span v-if="currentStatusList.PregnancyWay===2">备孕/移植</span>
        </td>
        <td v-if="currentStatusList.CurrentStatus===3">
          {{currentStatusList.PregnancyWeek}}周/{{currentStatusList.PregnancyDay}}天
        </td>
        <td>{{currentStatusList.Medicine?currentStatusList.Medicine:'无'}}</td>
        <td>{{currentStatusList.OtherMedicine?currentStatusList.OtherMedicine:'无'}}</td>
      </tr>
    </table>
    <h2>月经史</h2>
    <table>
      <tr>
        <th>首次月经</th>
        <th>首次月经年龄</th>
        <th>是否闭经</th>
        <th v-if="menstrualHistoryList.IsAmenorrhea===0">闭经年月</th>
        <th v-if="menstrualHistoryList.IsAmenorrhea===1">月经期</th>
        <th v-if="menstrualHistoryList.IsAmenorrhea===1">月经期是否规律</th>
        <th v-if="menstrualHistoryList.IsAmenorrhea===1">月经周期</th>
        <th v-if="menstrualHistoryList.IsAmenorrhea===1">月经周期是否规律</th>
        <th v-if="menstrualHistoryList.IsAmenorrhea===1">末次月经日期</th>
      </tr>
      <tr>
        <td>{{menstrualHistoryList.FirstDate.split('T')[0]}}</td>
        <td>年龄</td>
        <td>
          <span v-if="menstrualHistoryList.IsAmenorrhea===0">闭经</span>
          <span v-if="menstrualHistoryList.IsAmenorrhea===1">未闭经</span>
        </td>
        <td v-if="menstrualHistoryList.IsAmenorrhea===0">{{menstrualHistoryList.AmenorrheaDate.split('T')[0]}}</td>
        <td v-if="menstrualHistoryList.IsAmenorrhea===1">{{menstrualHistoryList.MaxTime}}天/{{menstrualHistoryList.MinTime}}天</td>
        <td v-if="menstrualHistoryList.IsAmenorrhea===1">
          <span v-if="menstrualHistoryList.IsRegular===0">规律</span>
          <span v-if="menstrualHistoryList.IsRegular===1">不规律</span>
        </td>
        <td v-if="menstrualHistoryList.IsAmenorrhea===1">{{menstrualHistoryList.Cycle_MaxTime}}天/{{menstrualHistoryList.Cycle_MinTime}}天</td>
        <td v-if="menstrualHistoryList.IsAmenorrhea===1">
          <span v-if="menstrualHistoryList.Cycle_IsRegular===0">规律</span>
          <span v-if="menstrualHistoryList.Cycle_IsRegular===1">不规律</span>
        </td>
        <td v-if="menstrualHistoryList.IsAmenorrhea===1">{{menstrualHistoryList.LastDate.split('T')[0]}}</td>
      </tr>
    </table>
    <h2 v-if="childbearingHistoryList.length!==0">生育史</h2>
    <table v-if="childbearingHistoryList.length!==0">
      <tr>
        <th>受孕/移植年月</th>
        <th>受孕方式</th>
        <th>是否生育</th>

        <th>孕周</th>
        <th>顺/剖腹产</th>

        <th>胚胎</th>
        <th>结局</th>
        <th>医院</th>
      </tr>
      <tr v-for="(item,index) in childbearingHistoryList" :key="index">
        <td>{{item.PregnancyTime.split('T')[0]}}</td>
        <td>
          <span v-if="item.PregnancyWay===0">自然受孕</span>
          <span v-if="item.PregnancyWay===1">人工授精</span>
          <span v-if="item.PregnancyWay===2">试管婴儿</span>
        </td>
        <td>
          <span v-if="item.IsChildbed===0">足月产</span>
          <span v-if="item.IsChildbed===1">早产</span>
          <span v-if="item.IsChildbed===2">流产</span>
        </td>

        <td>
          <span v-if="item.PregnancyWeek">{{item.PregnancyWeek}}周</span>
          <span v-if="!item.PregnancyWeek">0</span>
        </td>
        <td v-if="item.ChildbearingWay">
          <span v-if="item.ChildbearingWay===0">顺产</span>
          <span v-if="item.ChildbearingWay===1">剖腹产</span>
          <span v-if="item.ChildbearingWay===2">顺产转剖腹产</span>
        </td>
        <td v-if="!item.ChildbearingWay">无</td>

        <td>
          <div v-if="item.IsChildbed===2" class="childbearingHistoryEmbryoStatus">
            <p v-if="(item.EmbryoStatus && item.EmbryoStatus.split(',').includes('停止发育'))">停止发育({{item.StopDevelopment_Week}})周</p>
            <p v-if="(item.EmbryoStatus && item.EmbryoStatus.split(',').includes('胎膜早破'))">胎膜早破({{item.PROM_Week}})周</p>
            <p v-if="(item.EmbryoStatus && item.EmbryoStatus.split(',').includes('胎儿生长受限'))">生长受限({{item.FGR_Week}})周</p>
            <p v-if="(item.EmbryoStatus && item.EmbryoStatus.split(',').includes('子痫前期'))">子痫前期({{item.Preeclampsia_Week}})周</p>
            <p v-if="(item.EmbryoStatus && item.EmbryoStatus.split(',').includes('死胎'))">死胎({{item.DeadFetus_Week}})周</p>
            <p v-if="(item.EmbryoStatus && item.EmbryoStatus.split(',').includes('畸形儿'))">畸形儿({{item.OAF_Week}})周</p>

            <p v-if="item.EmbryoDetail===0">胚胎情况：无卵黄囊+无胎芽+无胎心</p>
            <p v-if="item.EmbryoDetail===1">胚胎情况：有卵黄囊+无胎芽+无胎心</p>
            <p v-if="item.EmbryoDetail===2">胚胎情况：有卵黄囊+有胎芽+无胎心</p>
            <p v-if="item.EmbryoDetail===3">胚胎情况：有卵黄囊+有胎芽+有胎心</p>

            <p v-if="item.EmbryoDye===0">胎染：无</p>
            <p v-if="item.EmbryoDye===1">胎染：正常</p>
            <p v-if="item.EmbryoDye===2">胎染：异常&nbsp;|&nbsp;<span v-if="item.Exception">{{item.Exception}}</span><span
                v-if="!item.Exception">无</span>&nbsp;|&nbsp;血肿：<span v-if="item.Hematoncus">有 {{item.Hematoncus}}</span><span
                v-if="!item.Hematoncus">无</span>&nbsp;|&nbsp;病理：<span v-if="item.Pathology">有 {{item.Pathology}}</span><span
                v-if="!item.Pathology">无</span></p>
            <p>
              保胎药：<span v-if="item.KeepPregnantMedicine">{{item.KeepPregnantMedicine}}</span><span v-if="!item.KeepPregnantMedicine">无</span>
            </p>
            <p>
              其它用药：<span v-if="item.OtherMedicine">{{item.OtherMedicine}}</span><span v-if="!item.OtherMedicine">无</span>
            </p>
          </div>
          <div v-if="item.IsChildbed!==2">无</div>
        </td>
        <td v-if="item.IsChildbed===2">
          <span v-if="item.EmbryoEnding===0">主动人流</span>
          <span v-if="item.EmbryoEnding===1">未着床</span>
          <span v-if="item.EmbryoEnding===2">生化妊娠</span>
          <span v-if="item.EmbryoEnding===3">完全流产</span>
          <span v-if="item.EmbryoEnding===4">药物流产</span>
          <span v-if="item.EmbryoEnding===5">清宫</span>
          <span v-if="item.EmbryoEnding===6">宫外孕</span>
          <span v-if="item.EmbryoEnding===7">葡萄胎</span>
          <span v-if="item.EmbryoEnding===8">引产</span>
          <span v-if="item.EmbryoEnding===9">刨宫产</span>
        </td>
        <td v-if="item.IsChildbed===2">{{item.Hospital}}</td>
      </tr>
    </table>
    <h2>婚育史</h2>
    <table>
      <tr>
        <th>结婚</th>
        <th>避孕方式</th>
        <th v-if="marriageList.ContraceptionWay.split(',').includes('避孕药')">避孕时长</th>
        <th>不孕(未避孕)</th>
        <th v-if="marriageList.IsAciesis===0">不孕年数</th>
        <th>足月产次数</th>
        <th>早产次数</th>
        <th>流产次数</th>
        <th>现存子女</th>
        <th>与现任配偶现存子女</th>
        <th>特殊说明</th>
      </tr>
      <tr>
        <td>{{marriageList.MarriageableAge}}年</td>
        <td>{{marriageList.ContraceptionWay}}</td>
        <td v-if="marriageList.ContraceptionWay.split(',').includes('避孕药')">{{marriageList.ContraceptionTime}}年</td>
        <td>
          <span v-if="marriageList.IsAciesis===0">不孕</span>
          <span v-if="marriageList.IsAciesis===1">否认</span>
        </td>
        <td v-if="marriageList.IsAciesis===0">{{marriageList.AciesisTime}}年</td>
        <td>{{marriageList.FullTermNumber}}</td>
        <td>{{marriageList.PrematureNumber}}</td>
        <td>{{marriageList.AbortionNumber}}</td>
        <td>{{marriageList.ChildrenNumber}}</td>
        <td>{{marriageList.ChildrenNumber1}}</td>
        <td>{{marriageList.Remark}}</td>
      </tr>
    </table>
    <h2 v-if="operationHistoryList.length!==0">既往史</h2>
    <table v-if="operationHistoryList.length!==0">
      <tr>
        <th>手术年月</th>
        <th>手术</th>
        <th>手术医院</th>
        <th>手术描述</th>
      </tr>
      <tr v-for="(item,index) in operationHistoryList" :key="index">
        <td>{{item.OperationDate.split('T')[0]}}</td>
        <td>
          <span v-if="item.Operation===0">宫腔镜手术</span>
          <span v-if="item.Operation===1">腹腔镜手术</span>
          <span v-if="item.Operation===2">其他 | 描述：{{item.OperationRemark}}</span>
        </td>
        <td>{{item.OperationHospital}}</td>
        <td>
          <span v-if="item.Remark">{{item.Remark}}</span>
          <span v-if="!item.Remark">无</span>
        </td>
      </tr>
    </table>
    <h2 v-if="operationHistoryList.length!==0">家族病史</h2>
    <table v-if="operationHistoryList.length!==0">
      <tr>
        <th>家族</th>
        <th>关系</th>
        <th>病史</th>
        <th>备注</th>
      </tr>
      <tr v-for="(item,index) in familyHistoryList" :key="index">
        <td>
          <span v-if="item.FamilyType===0">男方家族</span>
          <span v-if="item.FamilyType===1">女方家族</span>
        </td>
        <td>{{item.Relation}}</td>
        <td>
          <span v-if="!item.Medical.split(',').includes('其它')">{{item.Medical}}</span>
          <span v-if="item.Medical.split(',').includes('其它')">{{item.Medical}} | 其他病种:{{item.OtherMedical}}</span>
        </td>
        <td>{{item.Remark}}</td>
      </tr>
    </table>
    <h2 v-if="testTubeInfoList.length!==0">试管详情</h2>
    <table v-if="testTubeInfoList.length!==0">
      <tr>
        <th>开始促排年月</th>
        <th>移植完成年月</th>
        <th>取卵/配成</th>
        <th>冻胎/已移</th>
        <th>鲜胎/已移</th>
        <th>囊胎/已移</th>
        <th>试管技术</th>
      </tr>
      <tr v-for="(item,index) in testTubeInfoList" :key="index">
        <td>{{item.StartDate.split('T')[0]}}</td>
        <td>{{item.TransplantationDate.split('T')[0]}}</td>
        <td>{{item.GetOocyteNumber}}/{{item.EmbryoNumber}}</td>
        <td>{{item.FrozenEmbryos}}/{{item.FrozenEmbryosMove}}</td>
        <td>{{item.Freshembryos}}/{{item.FreshembryosMove}}</td>
        <td>{{item.Blastula}}/{{item.BlastulaMove}}</td>
        <td>
          <span v-if="item.TestTubeScience===0">1代</span>
          <span v-if="item.TestTubeScience===1">2代</span>
          <span v-if="item.TestTubeScience===2">3代</span>
        </td>
      </tr>
    </table>
  </div>

</div>
